package ClassWork.Work_03.Student;

public class StudentService {
    public static void BubbleSort(Student[] stu) {
        for (int i = 1; i < stu.length; i++) {
            for (int j = 0; j < stu.length - i; j++) {
                if (stu[j].getScore() < stu[j + 1].getScore()) {
                    Student temp = stu[j];
                    stu[j] = stu[j + 1];
                    stu[j + 1] = temp;
                }
            }
        }
    }

    public static void OutPut(Student[] stu) {
        for (int i = 0; i < stu.length; i++) {
            System.out.println(stu[i].getId() + " " + stu[i].getName() + " " + stu[i].getScore());
        }
    }
}
